//
//  JHJSpecialCollectionViewCell.m
//  DayByDay
//
//  Created by dllo on 16/5/24.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "JHJSpecialCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@interface JHJSpecialCollectionViewCell ()

@property (nonatomic, strong)UIImageView *imageV;
@property (nonatomic, strong)UILabel *nameLabel;
@property (nonatomic, strong)UILabel *singerLabel;

@end

@implementation JHJSpecialCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createView];
    }
    
    return self;
}

- (void)createView {
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.width)];
    self.imageV.backgroundColor = [UIColor blueColor];
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.width + 5, self.contentView.frame.size.width, 20)];
    self.singerLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.width + 25, self.contentView.frame.size.width, 15)];
    self.nameLabel.backgroundColor = [UIColor clearColor];
    self.singerLabel.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.imageV];
    [self.contentView addSubview:self.nameLabel];
    [self.contentView addSubview:self.singerLabel];
    self.singerLabel.font = [UIFont systemFontOfSize:14];
    self.singerLabel.textColor = [UIColor lightGrayColor];
    self.backgroundColor = [UIColor clearColor];
}

- (void)setSpecialModel:(CellSpecialModel *)specialModel {
    _specialModel = specialModel;
    [self.imageV sd_setImageWithURL:[NSURL URLWithString:_specialModel.picUrl] placeholderImage:[UIImage imageNamed:@"smiley_26"]];
    self.nameLabel.text = _specialModel.name;
    self.singerLabel.text = _specialModel.singerName;
}

@end
